using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class manager_main_login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void do_login(object sender, EventArgs e)
    {
        Admin admin = null;
        admin = Admin.get_admin(text_username.Text);
        if (admin != null && text_password.Text == admin.Password)
        {
            Session["Admin"] = text_username.Text;
            //DataTable table = new DataTable();
            //table = Module1.CreateDataSource(select);
            //int abc = table.Rows.Count;
            //Session["privilege"] = table;
            //panel_login.Visible = false;
            Response.Redirect("../site/list.aspx");
        }
        else
        {
            label_error.Text = "Log in failed ! Try again !!!";
            label_error.Visible = true;
        }
    }
}
